<%--
  Created by IntelliJ IDEA.
  User: ZhuChunXiao
  Date: 2017/6/5
  Time: 15:54
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %> <%@ page isELIgnored="false" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
  String path = request.getContextPath();
  String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>
<form id="form_order_finish" class="panel-body form-horizontal form-padding">
  <input type="hidden" name="keyId" id="keyId" value="${keyId}"/>

  <div class="form-group div-Hidden">
    <label class="col-md-2 control-label">订单交付时间<i class="fa fa-asterisk txt-color-red"></i></label>
    <div class="col-md-6">
      <div class="input-group date">
        <input type="text" class="form-control" id="finishDate" name="finishDate" placeholder="请选择订单交付时间"/>
        <span class="input-group-addon"><i class="ti-calendar"></i></span>
      </div>
    </div>
  </div>

  <div class="form-group">
    <label class="col-md-2 control-label">订单完成情况说明<i class="fa fa-asterisk txt-color-red"></i></label>
    <div class="col-md-6">
      <%--<div class="input-group col-md-6">--%>
      <input type="text" class="form-control" id="finishText" name="finishText" placeholder="请填写订单完成情况说明" >
      <%--</div>--%>
    </div>
  </div>
</form>

<script>

  function fn_order_finish_save(callback) {
    var tmp = $("input#finishText").val();
    if(!tmp){
      __toastr_error("请填写订单完成情况说明！");
      return false;
    }
    var tmp1 = $("input#finishDate").val();
    if(!tmp1){
      __toastr_error("请选择订单交付时间！");
      return false;
    }
    __form_save('form_order_finish', '<%=path%>/com/orderEntity/saveFinish/'+$("#keyId").val(),
            function(data){
              if(data.state == 1){
                callback(data.data);
              } else {
                callback();
              }
            }, function () {
              callback();
            });
  }

  // 日期选择
  $('.input-group.date').datepicker({
    format: 'yyyy-mm-dd',
    weekStart: 1,
    autoclose: true,
    todayBtn: 'linked',
    todayHighlight: true,
    language: 'zh-CN'
  });

</script>